﻿@*@{
    Web.Models.DatabaseContext db = new Web.Models.DatabaseContext();
    List<Web.Models.Category> cats = db.Categories.Where(c => c.IsDeleted == false).ToList();
    Boolean currentCat = false;
}*@
@{Boolean currentCat = false;}
<div class="box">
    <!-- category box -->
    <h2>Danh mục</h2>
    <div class="holder">
        <div class="frame-box">
            <!-- accordion -->
            <ul class="accordion">
                @{List<Biz.Category> cats = ViewBag.Categories;}
                @foreach (var c in cats)
                {
                    if (ViewBag.Category != null && ViewBag.Category.Id == c.Id)
                    {
                        currentCat = true;
                    }
                    else
                    {
                        currentCat = false;
                    }
                    <li>
                        <a href="/Product/Category/@c.Id" class="opener @if (currentCat)
                                                                        { @Html.Raw("ui-state-active");
                                                                        }"><span>@c.Name</span></a>
                    </li>
                }
            </ul>
        </div>
    </div>
</div>
